package conference;

import java.util.HashSet;
import java.util.Set;

/**
 * 
 * @author Rob Oesch
 *
 */
public class User {
	
	/**
	 * Constructor that creates a User 
	 * with no name or email.
	 */
	public User(){
		myFirstName = "";
		myLastName = "";
		myEmail = "";
	}
	
	/**
	 * Constructor that sets up default values.
	 * @param theFirstName First Name of User
	 * @param theLastName Last Name of User
	 * @param theEmail Email for User
	 */
	public User(final String theFirstName, 
			final String theLastName, 
			final String theEmail){
		myFirstName = theFirstName;
		myLastName = theLastName;
		myEmail = theEmail;
	}

	/**
	 * First Name of User.
	 */
	private String myFirstName;
	/**
	 * Last Name of User
	 */
	private String myLastName;
	/**
	 * Email for User
	 */
	private String myEmail;
	
	/**
	 * Get the first name value.
	 * -Precondition: none.
	 * -Postcondition: none.
	 * @return myFirstName
	 */
	public String getFirstName(){
		return myFirstName;
	}
	
	/**
	 * Set the first name value
	 * -Precondition: none.
	 * -Postcondition: myFirstName == theFirstName
	 * @param sFirstName First Name of User
	 */
	public void setFirstName(String theFirstName){
		myFirstName = theFirstName;
	}
	
	/**
	 * Get the last name value.
	 * -Precondition: none.
	 * -Postcondition: none.
	 * @return myLastName
	 */
	public String getLastName(){
		return myLastName;
	}
	
	/**
	 * Set the last name value
	 * -Precondition: none.
	 * -Postcondition: myLastName == theLastName
	 * @param sLastName Last Name of User
	 */
	public void setLastName(String theLastName){
		myLastName = theLastName;
	}
	
	/**
	 * Get the email of the user.
	 * -Precondition: none.
	 * -Postcondition: none.
	 * @return myEmail
	 */
	public String getEmail(){
		return myEmail;
	}
	
	/**
	 * Set the email of the user.
	 * -Precondition: none.
	 * -Postcondition: myEmail == theEmail
	 * @param sEmail Email of the user.
	 */
	public void setEmail(String theEmail){
		myEmail = theEmail;
	}
	
	public String getLastCommaFirst() {
		return myLastName + ", " + myFirstName;
	}
	
	protected boolean comparePerson(User theUser) {
		boolean result = Boolean.TRUE;
		if (!theUser.getFirstName().equals(getFirstName())) {
			result = Boolean.FALSE;
		} else if (!theUser.getLastName().equals(getLastName())) {
			result = Boolean.FALSE;
		} else if (!theUser.getEmail().equals(getEmail())) {
			result = Boolean.FALSE;
		}
		return result;	
	}
	
}
